import { SAVE_ALLCHANNELS, SAVE_CHANNELS } from '../constants/home'

const initValue = {
  useChannels: [],
  allChannels: [],
}
export default function login(state = initValue, action) {
  const { type, payload } = action
  switch (type) {
    case SAVE_CHANNELS:
      return {
        ...state,
        useChannels: payload,
      }
    case SAVE_ALLCHANNELS:
      return {
        ...state,
        allChannels: payload,
      }
    default:
      return state
  }
}
